package com.sdweizan.sdk.bytedance.api.impl;

import com.alibaba.fastjson.TypeReference;
import com.sdweizan.sdk.bytedance.api.BdApiService;
import com.sdweizan.sdk.bytedance.api.BdMiniAppService;
import com.sdweizan.sdk.bytedance.bean.withdraw.*;
import com.sdweizan.sdk.bytedance.error.BdErrorException;
import lombok.AllArgsConstructor;

@AllArgsConstructor
public class BdWithdrawService {
  private final BdApiService bdApiService;

  public BdMerchantWithdrawResponse merchantWithdraw(
      BdMerchantWithdrawRequest bdMerchantWithdrawRequest) throws BdErrorException {
    return bdApiService.post(
        bdMerchantWithdrawRequest, new TypeReference<BdMerchantWithdrawResponse>() {});
  }

  public BdQueryMerchantBalanceResponse queryMerchantBalance(
      BdQueryMerchantBalanceRequest bdQueryMerchantBalanceRequest) throws BdErrorException {
    return bdApiService.post(
        bdQueryMerchantBalanceRequest, new TypeReference<BdQueryMerchantBalanceResponse>() {});
  }

  public BdQueryWithdrawOrderResponse queryWithdrawOrder(
      BdQueryWithdrawOrderRequest bdQueryWithdrawOrderRequest) throws BdErrorException {
    return bdApiService.post(
        bdQueryWithdrawOrderRequest, new TypeReference<BdQueryWithdrawOrderResponse>() {});
  }
}
